<?php
/*
 * Created on Mar 11, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 class place_Model_Village extends Clu_Db_Table_Abstract
{
    //only specify the table name, everything else inherits
	protected $_name = "villages";
	protected $_primary = "village_id";
	
	public function getVillageName($village_id)
    {
	    $db = $this->getAdapter();
	    $sql = "SELECT v.village_name FROM villages v WHERE village_id =" .$db->quote($village_id,'INTEGER');
	    //$select = $db->query($sql);
	    //return $select->fetchAll();
	    return $db->fetchRow($sql);
	}
	
	public function getVillages($district_id)
    {
	    $db = $this->getAdapter();
	    $sql = "SELECT * FROM villages WHERE district_id =" .$db->quote($district_id,'INTEGER');
	    //$select = $db->query($sql);
	    //return $select->fetchAll();
	    return $db->fetchAll($sql);
	}
}
?>
